package com.wlcj.www.model.data;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.jfinal.plugin.activerecord.Model;

public class ProvinceIndustry extends Model<ProvinceIndustry> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2545835957826061360L;
	
	public static final ProvinceIndustry dao = new ProvinceIndustry();
	
	public List<ProvinceIndustry> getProvinceIndustry(String startTime, String endTime, String orderby) {
		orderby = StringUtils.isEmpty(orderby)?"volume desc":orderby;
		String sql = "select * from wd_new_province_industry_data where data_date >= ? and data_date < ? order by "+orderby;
		return dao.find(sql, startTime, endTime);
	}
	public List<ProvinceIndustry> getLittle(String litter,String litterTwo,String startdate,String stopdate) {
		String sql = "";
		if("".equals(litterTwo)){
		 sql = "select  province_id,"+litter+" from wd_new_province_industry_data where data_date >= ? and data_date < ? ";
		}else{
			sql = "select  province_id,"+litter+","+litterTwo+" from wd_new_province_industry_data where data_date >= ? and data_date < ? ";
		}
		
		return dao.find(sql,startdate,stopdate);
	}
	public List<ProvinceIndustry> getProvince(){
		return dao.find("select province_id from  wd_new_province_industry_data group by province_id");
	}
	
}
